package com.tuozixuan;

import static com.tuozixuan.GitDemoConstants.*;

import java.io.File;

import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;

public class GitHttpCredentialsDemo {

	public static void main(String[] args) throws Exception {
		// 账号 + 密码
		UsernamePasswordCredentialsProvider provider = new UsernamePasswordCredentialsProvider(USERNAME, PASSWORD);
		// 拉取远程更新        
		Git git = Git.open(new File(LOCAL_DIR));
		git.pull().setCredentialsProvider(provider).setRemoteBranchName(BRANCH_NAME).call();

	}

}
